﻿CREATE PROCEDURE [acms].[Topic_Delete]
	@Id int, 
	@VersionId Timestamp
AS
	Update Topics Set Deleted = 1 Where Id = @Id and VersionId = @VersionId
	
	if @@RowCount = 0 begin
		if exists (Select null from Topic_View where Id = @Id)
			return -100
		else
			return -200
	end
RETURN 0;